package cn.cgj.service.impl;

import cn.cgj.domain.BusinessInfo;
import cn.cgj.mapper.BusinessInfoMapper;
import cn.cgj.service.BusinessInfoService;
import cn.cgj.service.repository.BusinessInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class BusinessInfoServiceImpl implements BusinessInfoService {

    @Autowired
    private BusinessInfoRepository businessInfoRepository;

    @Autowired
    private BusinessInfoMapper businessInfoMapper;

    public BusinessInfoRepository getRepository() {
        return businessInfoRepository;
    }

    public BusinessInfo selectBusinessInfoById(Integer id) {
        return businessInfoMapper.selectBusinessInfoById(id);
    }

    public List<BusinessInfo> selectBusinessInfoList(BusinessInfo businessInfo) {
        return businessInfoMapper.selectBusinessInfoList(businessInfo);
    }

    @Transactional
    public int insertBusinessInfo(BusinessInfo businessInfo) {
        return businessInfoMapper.insertBusinessInfo(businessInfo);
    }

    @Transactional
    public int updateBusinessInfo(BusinessInfo businessInfo) {
        return businessInfoMapper.updateBusinessInfo(businessInfo);
    }

    @Transactional
    public int deleteBusinessInfoById(Integer id) {
        return businessInfoMapper.deleteBusinessInfoById(id);
    }

    @Transactional
    public int deleteBusinessInfoByIds(String[] ids) {
        return businessInfoMapper.deleteBusinessInfoByIds(ids);
    }

    @Transactional
    public int batchBusinessInfo(List<BusinessInfo> businessInfoList) {
        return businessInfoMapper.batchBusinessInfo(businessInfoList);
    }

}
